********************************************************************************
***********************REPLICATION CODE*****************************************

*WERNER, BERTSOU AND MARIEN. From Losers' Consent to Winners' Restraint:
*Citizens Reactions to Accumulating Democratic Violations
*STUDY 1


clear
use WernerBertsouMarien_2024_WinnersRestraint_S1_data.dta
ssc install g538schemes
set scheme 538 ///or set manually

collapse dichreplacePMr dichcampbreachr dichparlsuspensionr dichparlstayEUr dichgovagainstparlr dichgovagainstcourtr, by(pastvote_euref)
rename (dichreplacePMr dichcampbreachr dichparlsuspensionr dichparlstayEUr dichgovagainstparlr dichgovagainstcourtr) var=
reshape long var, i(pastvote_euref) j(which) string
reshape wide var, i(which) j(pastvote_euref)

encode which, gen(which2)
fre which2
recode which2 (1=2) (2=6) (3=5) (5=3) (6=1) 
label define which2l 1 "Replacing PM wihout GE" 2 "Campaign breaches electoral law" 3 "Gov. prorogues parl." 4 "Parl. disregards referendum" 5 "Gov. disregards parl" 6 "Gov. disregards court ruling" 
label values which2 which2l

gr dot  var?,  over(which2)  marker(1, m(O) msize(medium)) marker(2, m(O) msize(medium)) marker(3, m(T)msize(medium) mcolor(grey)) leg(order(1 "Remain" 2 "Leave" 3 "did not vote")) yscale(r(0 1)) ylabel(0(.1)1) linetype(line) title("Proportion of respondent that consider behavior unacceptable") xsize(7) 

